package com.zks.controller;

import com.zks.model.User;
import com.zks.service.UserService;
import com.zks.util.returnData.OpenResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;


@Controller
@CrossOrigin
@RequestMapping(value = "/user")
public class UserController {

    @Autowired
    private UserService userService;

    @ResponseBody
    @PostMapping("/login")
    public OpenResponse<User> login(@RequestBody User user) {
        return   userService.login(user);
    }

    @ResponseBody
    @RequestMapping("/test")
    public String test() {
        System.out.println("123456");
        return "123";
    }
}
